<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <script src="js/angular1.5.8.min.js"></script>
    </head>

    <body>
        <div ng-app="myApp" ng-controller="firstController">
            Hello{{name}}
            <button ng-click="add(1)">add</button>
            <button ng-click="subtract(1)">subtract</button>
            <h1>count:{{count}}</h1>
            <h1>person:{{person}}</h1>
            <h1>person.name:{{person.name}}</h1>
        </div>
        <script>
            angular.module("myApp",[])
                   .controller('firstController',function($scope){
                       $scope.name="dujiang";
                       $scope.count=0;
                       $scope.add=function(amount){
                           $scope.count+=amount;
                       }
                       $scope.subtract=function(amount){
                            $scope.count-=amount;
                       }

                       $scope.person={
                           name:"Do"
                       }
                       console.log($scope.person);
                   });
        </script>
    </body>
</html>